//
//  ZHNetworkHandler.h
//  DelightTrip
//
//  Created by dllo on 16/5/11.
//  Copyright © 2016年 Northeast Dianli University. All rights reserved.
//


#import <Foundation/Foundation.h>

typedef void(^blockOfSuccess)(id result);
typedef void(^blockOfFailure)(NSError *error);

typedef NS_ENUM(NSUInteger, ZHResponseStyle) {
    ZHJSON,
    ZHDATA,
    ZHXML,
};

typedef NS_ENUM(NSUInteger, ZHRequestStyle) {
    ZHBodyJSON,
    ZHBodyString,
};

@interface ZHNetworkHandler : NSObject
+ (void)getDataByURLString:(NSString *)urlString
            WithBodyString:(NSString *)bodyString
             WithHeaderDic:(NSDictionary *)headerDic
              WithResponse:(ZHResponseStyle)response
               WithSuccess:(blockOfSuccess)success
               WithFailure:(blockOfFailure)failure;

+ (void)postDataByURLString:(NSString *)urlString
             WithBodyString:(NSString *)bodyString
              WithBodyStyle:(ZHRequestStyle)bodyStyle
              WithHeaderDic:(NSDictionary *)headerDic
               WithResponse:(ZHResponseStyle)response
                WithSuccess:(blockOfSuccess)success
                WithFailure:(blockOfFailure)failure;
@end
